﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CMS.BLL;

public partial class Controls_FAQ_ctrFAQDetail : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.LoadData();
        }
    }

    private void LoadData()
    {
        try
        {
            int nCurrentLang = Support.GetCurrentLanguage();
            int nItemID = ConvertData.ConvertToInt(Request.QueryString[Config.FAQ_ID]);
            FAQs objFAQs = new FAQs();
            objFAQs.LoadById(nItemID);
            int ncount = objFAQs.Data.Count;
            objFAQs.UpdateCount(nItemID, ncount + 1);

            switch (nCurrentLang)
            {
                case 1:
                    ltrQuestion.Text = objFAQs.Data.Question1 ;
                    ltrContent.Text = objFAQs.Data.Answer1 ;
                    break;
                case 2:
                    ltrQuestion.Text = objFAQs.Data.Question2 ;
                    ltrContent.Text = objFAQs.Data.Answer2 ;
                    break;
                case 3:
                    ltrQuestion.Text = objFAQs.Data.Question3 ;
                    ltrContent.Text = objFAQs.Data.Answer3 ;
                    break;
            }
        }
        catch { Response.Redirect("~/Default.aspx"); }
    }
}
